.class Lcom/tendcloud/tenddata/eg;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/tendcloud/tenddata/ej$g;


# annotations
.annotation build Landroid/annotation/TargetApi;
    value = 0x10
.end annotation


# static fields
.field private static final A:I = 0x8

.field private static final B:I = 0x9

.field private static final C:I = 0xa

.field private static final D:I = 0xb

.field private static final E:I = 0xc

.field static final b:I = 0x1

.field public static final c:I = 0xd

.field public static final d:Ljava/lang/String; = ""

.field static final e:Z = false

.field static final f:Z = false

.field static final g:Ljava/lang/String; = "TDDynamicEvent"

.field static final h:Ljava/lang/String; = "TDExceptionLog"

.field private static final i:Ljava/lang/String; = "cls.xdrig.com"

.field private static final j:Ljava/lang/String; = "wss"

.field private static final k:Ljava/lang/String; = "/codeless/app/sdk/"

.field private static volatile l:Lcom/tendcloud/tenddata/eg; = null

.field private static final r:Ljava/lang/String; = "talkingdata.viewcrawler.changes"

.field private static final s:Ljava/lang/String; = "config.events"

.field private static final t:I = 0x0

.field private static final u:I = 0x2

.field private static final v:I = 0x3

.field private static final w:I = 0x4

.field private static final x:I = 0x5

.field private static final y:I = 0x6

.field private static final z:I = 0x7


# instance fields
.field final a:Lcom/tendcloud/tenddata/dz;

.field private final m:Landroid/content/Context;

.field private final n:Lcom/tendcloud/tenddata/ec;

.field private final o:Ljava/util/Map;

.field private final p:Lcom/tendcloud/tenddata/eg$d;

.field private final q:F


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    sput-object v0, Lcom/tendcloud/tenddata/eg;->l:Lcom/tendcloud/tenddata/eg;

    return-void
.end method

.method private constructor <init>(Landroid/content/Context;Ljava/lang/String;Lcom/tendcloud/tenddata/em;)V
    .locals 6

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lcom/tendcloud/tenddata/eg;->m:Landroid/content/Context;

    new-instance v0, Lcom/tendcloud/tenddata/dz;

    invoke-direct {v0}, Lcom/tendcloud/tenddata/dz;-><init>()V

    iput-object v0, p0, Lcom/tendcloud/tenddata/eg;->a:Lcom/tendcloud/tenddata/dz;

    invoke-virtual {p0}, Lcom/tendcloud/tenddata/eg;->d()Ljava/util/Map;

    move-result-object v0

    iput-object v0, p0, Lcom/tendcloud/tenddata/eg;->o:Ljava/util/Map;

    invoke-static {}, Landroid/content/res/Resources;->getSystem()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v0

    iget v0, v0, Landroid/util/DisplayMetrics;->scaledDensity:F

    iput v0, p0, Lcom/tendcloud/tenddata/eg;->q:F

    iget-object v0, p0, Lcom/tendcloud/tenddata/eg;->a:Lcom/tendcloud/tenddata/dz;

    invoke-virtual {p3, v0}, Lcom/tendcloud/tenddata/em;->a(Lcom/tendcloud/tenddata/dz;)V

    new-instance v1, Landroid/os/HandlerThread;

    const-string v0, "CodelessViewCrawler"

    invoke-direct {v1, v0}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V

    const/16 v0, 0xa

    invoke-virtual {v1, v0}, Landroid/os/HandlerThread;->setPriority(I)V

    invoke-virtual {v1}, Landroid/os/HandlerThread;->start()V

    new-instance v0, Lcom/tendcloud/tenddata/eg$d;

    invoke-virtual {v1}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;

    move-result-object v4

    move-object v1, p0

    move-object v2, p1

    move-object v3, p2

    move-object v5, p0

    invoke-direct/range {v0 .. v5}, Lcom/tendcloud/tenddata/eg$d;-><init>(Lcom/tendcloud/tenddata/eg;Landroid/content/Context;Ljava/lang/String;Landroid/os/Looper;Lcom/tendcloud/tenddata/ej$g;)V

    iput-object v0, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    invoke-static {}, Lcom/tendcloud/tenddata/fo;->a()Lcom/tendcloud/tenddata/fo;

    move-result-object v0

    iget-object v1, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    invoke-virtual {v0, v1}, Lcom/tendcloud/tenddata/fo;->a(Landroid/os/Handler;)V

    new-instance v0, Lcom/tendcloud/tenddata/ec;

    iget-object v1, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    invoke-direct {v0, v1}, Lcom/tendcloud/tenddata/ec;-><init>(Landroid/os/Handler;)V

    iput-object v0, p0, Lcom/tendcloud/tenddata/eg;->n:Lcom/tendcloud/tenddata/ec;

    invoke-virtual {p0}, Lcom/tendcloud/tenddata/eg;->c()V

    return-void
.end method

.method static synthetic a(Lcom/tendcloud/tenddata/eg;)F
    .locals 1

    iget v0, p0, Lcom/tendcloud/tenddata/eg;->q:F

    return v0
.end method

.method static a()Lcom/tendcloud/tenddata/eg;
    .locals 1

    sget-object v0, Lcom/tendcloud/tenddata/eg;->l:Lcom/tendcloud/tenddata/eg;

    return-object v0
.end method

.method static a(Landroid/content/Context;Ljava/lang/String;Lcom/tendcloud/tenddata/em;)Lcom/tendcloud/tenddata/eg;
    .locals 2

    sget-object v0, Lcom/tendcloud/tenddata/eg;->l:Lcom/tendcloud/tenddata/eg;

    if-nez v0, :cond_1

    const-class v1, Lcom/tendcloud/tenddata/eg;

    monitor-enter v1

    :try_start_0
    sget-object v0, Lcom/tendcloud/tenddata/eg;->l:Lcom/tendcloud/tenddata/eg;

    if-nez v0, :cond_0

    new-instance v0, Lcom/tendcloud/tenddata/eg;

    invoke-direct {v0, p0, p1, p2}, Lcom/tendcloud/tenddata/eg;-><init>(Landroid/content/Context;Ljava/lang/String;Lcom/tendcloud/tenddata/em;)V

    sput-object v0, Lcom/tendcloud/tenddata/eg;->l:Lcom/tendcloud/tenddata/eg;

    :cond_0
    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :cond_1
    sget-object v0, Lcom/tendcloud/tenddata/eg;->l:Lcom/tendcloud/tenddata/eg;

    return-object v0

    :catchall_0
    move-exception v0

    :try_start_1
    monitor-exit v1
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0
.end method

.method static synthetic a(Lorg/json/JSONObject;Ljava/lang/String;)Ljava/lang/String;
    .locals 1

    invoke-static {p0, p1}, Lcom/tendcloud/tenddata/eg;->b(Lorg/json/JSONObject;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method static synthetic a(Ljava/lang/String;)Ljava/security/cert/X509Certificate;
    .locals 1

    invoke-static {p0}, Lcom/tendcloud/tenddata/eg;->b(Ljava/lang/String;)Ljava/security/cert/X509Certificate;

    move-result-object v0

    return-object v0
.end method

.method private static b(Lorg/json/JSONObject;Ljava/lang/String;)Ljava/lang/String;
    .locals 1

    invoke-virtual {p0, p1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p0, p1}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    invoke-virtual {p0, p1}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    :goto_0
    return-object v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private static b(Ljava/lang/String;)Ljava/security/cert/X509Certificate;
    .locals 3

    const/4 v1, 0x0

    invoke-static {p0}, Lcom/tendcloud/tenddata/ca;->b(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    :goto_0
    return-object v1

    :cond_0
    new-instance v0, Ljava/io/ByteArrayInputStream;

    invoke-virtual {p0}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    invoke-direct {v0, v2}, Ljava/io/ByteArrayInputStream;-><init>([B)V

    :try_start_0
    const-string v2, "X.509"

    invoke-static {v2}, Ljava/security/cert/CertificateFactory;->getInstance(Ljava/lang/String;)Ljava/security/cert/CertificateFactory;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/security/cert/CertificateFactory;->generateCertificate(Ljava/io/InputStream;)Ljava/security/cert/Certificate;

    move-result-object v0

    check-cast v0, Ljava/security/cert/X509Certificate;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :goto_1
    move-object v1, v0

    goto :goto_0

    :catch_0
    move-exception v0

    move-object v0, v1

    goto :goto_1

    :catchall_0
    move-exception v0

    throw v0
.end method

.method static synthetic b(Lcom/tendcloud/tenddata/eg;)Ljava/util/Map;
    .locals 1

    iget-object v0, p0, Lcom/tendcloud/tenddata/eg;->o:Ljava/util/Map;

    return-object v0
.end method

.method static synthetic c(Lcom/tendcloud/tenddata/eg;)Lcom/tendcloud/tenddata/ec;
    .locals 1

    iget-object v0, p0, Lcom/tendcloud/tenddata/eg;->n:Lcom/tendcloud/tenddata/ec;

    return-object v0
.end method

.method static synthetic d(Lcom/tendcloud/tenddata/eg;)Lcom/tendcloud/tenddata/eg$d;
    .locals 1

    iget-object v0, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    return-object v0
.end method

.method static synthetic e()Lcom/tendcloud/tenddata/eg;
    .locals 1

    sget-object v0, Lcom/tendcloud/tenddata/eg;->l:Lcom/tendcloud/tenddata/eg;

    return-object v0
.end method


# virtual methods
.method b()Lcom/tendcloud/tenddata/eg$d;
    .locals 1

    iget-object v0, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    return-object v0
.end method

.method public c()V
    .locals 3

    iget-object v0, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    invoke-virtual {v0}, Lcom/tendcloud/tenddata/eg$d;->a()V

    iget-object v0, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    iget-object v1, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Lcom/tendcloud/tenddata/eg$d;->obtainMessage(I)Landroid/os/Message;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/tendcloud/tenddata/eg$d;->sendMessage(Landroid/os/Message;)Z

    return-void
.end method

.method public d()Ljava/util/Map;
    .locals 4

    new-instance v1, Ljava/util/HashMap;

    invoke-direct {v1}, Ljava/util/HashMap;-><init>()V

    const-string v0, "sdk_version"

    const-string v2, "+V2.2.48 gp"

    invoke-interface {v1, v0, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string v0, "system_name"

    const-string v2, "Android"

    invoke-interface {v1, v0, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string v2, "system_version"

    sget-object v0, Landroid/os/Build$VERSION;->RELEASE:Ljava/lang/String;

    if-nez v0, :cond_0

    const-string v0, "UNKNOWN"

    :goto_0
    invoke-interface {v1, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string v2, "device_manufacturer"

    sget-object v0, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;

    if-nez v0, :cond_1

    const-string v0, "UNKNOWN"

    :goto_1
    invoke-interface {v1, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string v2, "device_brand"

    sget-object v0, Landroid/os/Build;->BRAND:Ljava/lang/String;

    if-nez v0, :cond_2

    const-string v0, "UNKNOWN"

    :goto_2
    invoke-interface {v1, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string v2, "device_model"

    sget-object v0, Landroid/os/Build;->MODEL:Ljava/lang/String;

    if-nez v0, :cond_3

    const-string v0, "UNKNOWN"

    :goto_3
    invoke-interface {v1, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :try_start_0
    iget-object v0, p0, Lcom/tendcloud/tenddata/eg;->m:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v0

    iget-object v2, p0, Lcom/tendcloud/tenddata/eg;->m:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x0

    invoke-virtual {v0, v2, v3}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;

    move-result-object v0

    const-string v2, "app_version"

    iget-object v3, v0, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;

    invoke-interface {v1, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string v2, "app_version_code"

    iget v0, v0, Landroid/content/pm/PackageInfo;->versionCode:I

    invoke-static {v0}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v0

    invoke-interface {v1, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    :goto_4
    return-object v1

    :cond_0
    sget-object v0, Landroid/os/Build$VERSION;->RELEASE:Ljava/lang/String;

    goto :goto_0

    :cond_1
    sget-object v0, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;

    goto :goto_1

    :cond_2
    sget-object v0, Landroid/os/Build;->BRAND:Ljava/lang/String;

    goto :goto_2

    :cond_3
    sget-object v0, Landroid/os/Build;->MODEL:Ljava/lang/String;

    goto :goto_3

    :catch_0
    move-exception v0

    goto :goto_4
.end method

.method public onLayoutError(Lcom/tendcloud/tenddata/ej$e;)V
    .locals 2

    iget-object v0, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    invoke-virtual {v0}, Lcom/tendcloud/tenddata/eg$d;->obtainMessage()Landroid/os/Message;

    move-result-object v0

    const/16 v1, 0xc

    iput v1, v0, Landroid/os/Message;->what:I

    iput-object p1, v0, Landroid/os/Message;->obj:Ljava/lang/Object;

    iget-object v1, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    invoke-virtual {v1, v0}, Lcom/tendcloud/tenddata/eg$d;->sendMessage(Landroid/os/Message;)Z

    return-void
.end method

.method public setEventBindings(Lorg/json/JSONArray;)V
    .locals 2

    iget-object v0, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    const/4 v1, 0x5

    invoke-virtual {v0, v1}, Lcom/tendcloud/tenddata/eg$d;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    iput-object p1, v0, Landroid/os/Message;->obj:Ljava/lang/Object;

    iget-object v1, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    invoke-virtual {v1, v0}, Lcom/tendcloud/tenddata/eg$d;->sendMessage(Landroid/os/Message;)Z

    return-void
.end method

.method public setVariants(Lorg/json/JSONArray;)V
    .locals 2

    iget-object v0, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    const/16 v1, 0x9

    invoke-virtual {v0, v1}, Lcom/tendcloud/tenddata/eg$d;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    iput-object p1, v0, Landroid/os/Message;->obj:Ljava/lang/Object;

    iget-object v1, p0, Lcom/tendcloud/tenddata/eg;->p:Lcom/tendcloud/tenddata/eg$d;

    invoke-virtual {v1, v0}, Lcom/tendcloud/tenddata/eg$d;->sendMessage(Landroid/os/Message;)Z

    return-void
.end method
